home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-22 | 2.7 KB | 103 lines | [TEXT/BROW] |
- // SoundInputDevice.h
- // Created by Bill Hubauer on Sat, Jun 17, 1995 @ 5:55 PM.
-
- #ifndef __SoundInputDevice__
- #define __SoundInputDevice__
-
-
- #ifndef __SOUNDINPUT__
- #include <soundinput.h>
- #endif
-
- #ifndef __SSTYPES__
- #include "SSTypes.h"
- #endif
-
- typedef pascal void (*SRecordCompletionProc)(OSErr ioResult,UInt32 count,void* userData);
-
- #define kDefaultDeviceName "\p"
-
- class CSoundInputDevice
- {
- public:
- CSoundInputDevice(ConstStr255Param deviceName); // pass kDefaultDeviceName
- virtual ~CSoundInputDevice();
-
- OSErr Open();
- void Close();
- Boolean OpenQ() {return _openQ;}
-
- OSErr Record(Ptr buffer,UInt32 bufSize,SRecordCompletionProc proc,void* userData);
-
- // channels
- // enum SChannel { rightChannel = 1 , leftChannel = 2 , stereo = 3};
- // OSErr GetMaxChannels(UInt32& numChannels) = 0;
- // OSErr SetNumChannels(UInt32 numChannelsToUse) = 0;
- OSErr GetNumChannels(UInt32& numChannelsInUse);
- // OSErr SetActiveChannels(SChannel channel) = 0;
- // OSErr GetActiveChannels(SChannel& channel) = 0;
-
- // async support
- OSErr SupportsAsyncQ(Boolean& asyncQ);
-
- // compression
- // OSErr GetNumCompressions(UInt32& numCompressions) = 0;
- // OSErr GetCompressionList(OSType* list,UInt32& maxNumber) = 0;
- OSErr GetSoundHeader(SHeader& header,UInt32 numBytesInSound);
- OSErr GetCurrentCompression(OSType& compType);
- // OSErr GetCurrentCompressionFactor(UInt32& factor) = 0;
- // OSErr SetCurrentCompression(OSType compType) = 0;
-
- // info
- // OSErr GetDeviceName(Str255Param name) = 0;
-
- // input sources
- // OSErr GetInputSourceIndex(UInt32& index) = 0;
- // OSErr SetInputSourceIndex(UInt32 index) = 0;
- // OSErr GetInputSourceCount(UInt32& numSources) = 0;
- // OSErr GetIndInputSource(UInt32 index,Str255Param name) = 0;
-
- // gain
- OSErr SetAutoGainControl(Boolean on);
- OSErr SetGain(Fixed newGain);
-
- // play thru
- // OSErr GetPlayThruStatus(Boolean& onQ) = 0;
- // OSErr SetPlayThruStatus(Boolean& offQ) = 0;
-
- // record settings
- // siBestQuality , siBetterQuality, siGoodQuality
- OSErr SetGeneralQuality(OSType quality);
- OSErr GetGeneralQuality(OSType& quality);
-
- // sample rates
- OSErr GetSampleRate(Fixed& rate);
- // OSErr SetSampleRate(Fixed rate) = 0;
- // OSErr GetNumSampleRates(UInt32& numRates) = 0;
- // OSErr GetSampleRateList(Fixed* rateList,UInt32& maxRates) =0;
-
- // sample sizes
- OSErr GetSampleSize(UInt32& size);
- // OSErr SetSampleSize(UInt32 size) = 0;
- // OSErr GetNumSampleSizes(UInt32& numSizes) = 0;
- // OSErr GetSampleSizeList(UInt32* list,UInt32& numSizes) = 0;
-
-
- private:
-
- static pascal void _RecordCompletion(SPBPtr pb);
- void RecordCompletion(SPBPtr pb);
-
-
- SInt32 _refNum;
- Str255 _deviceName;
- Boolean _openQ;
-
- long _saveGlobals;
- SRecordCompletionProc _recordCompletion;
- void* _recordUserData;
- SPB _pb;
- };
-
- #endif
-